package com.xingfly.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xingfly.dao.TempDao;
import com.xingfly.model.dto.Temp;
import com.xingfly.model.dto.User;
import com.xingfly.service.TempService;
@Service("tempService")
public class TempServiceImpl implements TempService{
  @Resource
  private TempDao tempdao;
   /**
    * 查询临时表全部信息
    */
	@Override
	public List<Temp> SelByAll() {
		List<Temp> selByAll=null;
		try {
			selByAll = tempdao.SelByAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return selByAll;
	}
	/**
	 * 乘客表 临时表联查
	 */
	@Override
	public List<com.xingfly.suan.Temp> SelByJoinAll() {
		List<com.xingfly.suan.Temp> selByJoinAll=null;
		try {
			selByJoinAll = tempdao.SelByJoinAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return selByJoinAll;
	}
	/**
	 *查询组id
	 */
	@Override
	public int selBySERIALMax() {
			int selBySERIALMax=0;
		try {
			selBySERIALMax = tempdao.selBySERIALMax();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return selBySERIALMax;
	}
	/**
	 * 插入全部信息
	 * 1插入成功 0失败
	 */
	@Override
	public int insertBysatis(int uid, int seid, int serial, float satis) {
			int insertBysatis=0;
		try {
			insertBysatis = tempdao.insertBysatis(uid, seid, serial, satis);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return insertBysatis;
	}
	/**
	 * 查询临时表总条数
	 */
	@Override
	public int selByCount() {
			int selByCount=0;
		try {
			selByCount = tempdao.selByCount();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return selByCount;
	}
	/**
	 * 删除临时表中的信息
	 */
	@Override
	public int deleteByAll() {
		    int deleteByAll=0;
		 try {
			deleteByAll = tempdao.deleteByAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return deleteByAll;
	}
	/**
	 * 临时表和用户表的连接查询
	 */
	@Override
	public List<Temp> selByTempandusers() {
		List<Temp> selByTempandusers=null;
		try {
			selByTempandusers = tempdao.selByTempandusers();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return selByTempandusers;
	}

}
